package com.gxtbindings.bindings.client;

import com.extjs.gxt.ui.client.data.ModelData;

public interface ListStoreConverter<E,M extends ModelData> {

	/**
	 * Converts the given object into a ModelData instance.  It's not required that this
	 * method return the same ModelData instance that already exists in the store (if applicable).
	 * 
	 * This method should only be used for new ModelData objects being inserted into the store, i.e.
	 * not to look up existing ModelData objects in the store.
	 * 
	 * @param object	the object to convert
	 * @return	the modeldata
	 */
	public M convertObjectToModel(E object);
	
	/**
	 * Converts the modeldata instance into the given object
	 * 
	 * @param model	the modeldata to convert
	 * @return	the object
	 */
	public E convertModelValue(M model);
}
